package com.tdrc.common.beans;

import java.util.List;

/**
 * @author dpf
 * @version 1.0
 * @date 2020-4-1 11:08
 * @instruction 菜单实体类（根据Ant Desgin Pro设定 ，地址https://pro.loacg.com/docs/router-and-nav）
 */
public class Menu {
    /**
     * 菜单ID
     */
    private Integer id;
    /**
     * 父菜单ID
     */
    private Integer parentId;
    /**
     * 路由名称
     */
    private String name;
    /**
     * 组件名称
     */
    private String component;
    /**
     * 地址重定向
     */
    private String redirect;
    /**
     * 菜单类型M为菜单，B为按钮
     */
    private String menuType;
    /**
     * 权限
     */
    private String permis;
    /**
     * 排序
     */
    private Integer sort;
    /**
     * 路由元信息
     */
    private Meta meta;
    /**
     * 子菜单
     */
    private List<Menu> children;
    /**
     * 菜单名，用于显示菜单名称
     */
    private String menuName;
    public Menu() {

    }

    public Menu(Integer id, Integer parentId, String name, String component, String redirect, String menuType, String permis, Integer sort, Meta meta, List<Menu> children,String menuName) {
        this.id = id;
        this.parentId = parentId;
        this.name = name;
        this.component = component;
        this.redirect = redirect;
        this.menuType = menuType;
        this.permis = permis;
        this.sort = sort;
        this.meta = meta;
        this.children = children;
        this.menuName = menuName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getComponent() {
        return component;
    }

    public void setComponent(String component) {
        this.component = component;
    }

    public String getRedirect() {
        return redirect;
    }

    public void setRedirect(String redirect) {
        this.redirect = redirect;
    }

    public String getMenuType() {
        return menuType;
    }

    public void setMenuType(String menuType) {
        this.menuType = menuType;
    }

    public String getPermis() {
        return permis;
    }

    public void setPermis(String permis) {
        this.permis = permis;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Meta getMeta() {
        return meta;
    }

    public void setMeta(Meta meta) {
        this.meta = meta;
    }

    public List<Menu> getChildren() {
        return children;
    }

    public void setChildren(List<Menu> children) {
        this.children = children;
    }
    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    /**
     * 内部类，真主要包含路由元信息
     */
    static class Meta {
        private String icon;
        private String title;
        private Boolean show;
        private String target;
        private List<String> permission;

        Meta() {

        }

        public Meta(String icon, String title, Boolean show, String target, List<String> permission) {
            this.icon = icon;
            this.title = title;
            this.show = show;
            this.target = target;
            this.permission = permission;
        }

        public String getIcon() {
            return icon;
        }

        public void setIcon(String icon) {
            this.icon = icon;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public Boolean getShow() {
            return show;
        }

        public void setShow(Boolean show) {
            this.show = show;
        }

        public String getTarget() {
            return target;
        }

        public void setTarget(String target) {
            this.target = target;
        }

        public List<String> getPermission() {
            return permission;
        }

        public void setPermission(List<String> permission) {
            this.permission = permission;
        }
    }


}
